﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using ZX.Common.File;
using ZX.Web.UI.Controls;

namespace ZX.WebApp.ExtendPage.CtrlPage
{
    public partial class FileEditor : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string path = GetStringFromQueryString("path", "");
            path = path.Substring(0,2).Contains(':')?path:Server.MapPath( path);
            FileName = ZX.Common.FileHelper.GetFileNameNoPath(path);
            FilePath = ZX.Common.FileHelper.GetFileDir(path)+"\\";
            FileContent = ZX.Common.FileHelper.GetFileContent(path);
        }


        public string FileContent
        {
            get;
            set;
        }

        public string FileName
        {
            get;
            set;
        }

        public string FilePath
        {
            get;
            set;
        }
    }
}